package com.qyhl.webtv.module_news.news.video;


import com.qyhl.webtv.commonlib.entity.intergral.CoinBean;
import com.qyhl.webtv.commonlib.entity.news.NormalNewsBean;

/**
 * Created by qyhl on 2017/12/7.
 */

public class VideoNewsPresenter implements VideoNewsContract.VideoNewsPresenter {
    private VideoNewsModel mModel;

    private VideoNewsActivity mView;

    public VideoNewsPresenter(VideoNewsActivity mView) {
        this.mView = mView;
        this.mModel = new VideoNewsModel(this);
    }

    @Override
    public void getDetail(String newsId) {
        mModel.getDetail(newsId);
    }

    @Override
    public void collect(String newsId) {
        mModel.collect(newsId);
    }

    @Override
    public void cancelCollect(String newsId) {
        mModel.cancelCollect(newsId);
    }

    @Override
    public void sendComment(String title, String catalogId, String type, String id, String commentUser, String content) {
        mModel.sendComment(title, catalogId, type, id, commentUser, content);
    }

    @Override
    public void count(String newsId) {
        mModel.count(newsId);
    }

    @Override
    public void setDetail(NormalNewsBean bean) {
        mView.setDetail(bean);
    }

    @Override
    public void setError(int code, String msg) {
        switch (code) {
            case 0:
                mView.setNetError(msg);
                break;
            case 1:
                mView.setError(msg);
                break;
            case 2:
                mView.setEmpty(msg);
                break;
            default:
                break;
        }
    }

    @Override
    public void collectSuccess(String msg) {
        mView.collectSuccess(msg);
    }

    @Override
    public void collectError(String msg) {
        mView.collectError(msg);
    }

    @Override
    public void cancelCollectSuccess() {
        mView.cancelCollectSuccess();
    }

    @Override
    public void cancelCollectError(String msg) {
        mView.cancelCollectError(msg);
    }

    @Override
    public void sendSuccess(String msg) {
        mView.sendSuccess(msg);
    }

    @Override
    public void sendError(String msg) {
        mView.sendError(msg);
    }

    @Override
    public void cancelCollect() {
        mView.cancelCollect();
    }

    @Override
    public void getCoin(String username) {
        mModel.getCoin(username);
    }

    @Override
    public void getCoinSuccess(CoinBean bean) {
        mView.getCoinSuccess(bean);
    }

    @Override
    public void getCoinFailure(String msg) {
        mView.getCoinFailure(msg);
    }

    @Override
    public void getCommentCoin(String type,String name) {
        mModel.getCommentCoin(type,name);
    }

    @Override
    public void getComCoinSuccess(CoinBean coinBean) {
        mView.getComCoinSuccess(coinBean);
    }

    @Override
    public void getComCoinError(String msg) {
        mView.getComCoinError(msg);
    }

    @Override
    public void like(String newsId) {
        mModel.like(newsId);
    }

    @Override
    public void cancelLike(String newsId) {
        mModel.cancelLike(newsId);
    }

    @Override
    public void likeSuccess() {
        mView.likeSuccess();
    }

    @Override
    public void likeError(String msg) {
        mView.likeError(msg);
    }

    @Override
    public void cancelLikeSuccess() {
        mView.cancelLikeSuccess();
    }

    @Override
    public void cancelLikeError(String msg) {
        mView.cancelLikeError(msg);
    }

    @Override
    public void shareCount(String newsId) {
        mModel.shareCount(newsId);
    }
}
